# 1 "poll.c"
# 1 "<built-in>"
# 1 "<command-line>"
# 31 "<command-line>"
# 1 "/usr/include/stdc-predef.h" 1 3 4
# 32 "<command-line>" 2
# 1 "poll.c"
# 50 "poll.c"
static const char *types__poll[] = { __MAP(3,__SC_STR_TDECL,struct pollfd __user *, ufds, unsigned int, nfds, int, timeout_msecs) }; 
static const char *args__poll[] = { __MAP(3,__SC_STR_ADECL,struct pollfd __user *, ufds, unsigned int, nfds, int, timeout_msecs) }; SYSCALL_TRACE_ENTER_EVENT(_poll); 
SYSCALL_TRACE_EXIT_EVENT(_poll); 
static struct syscall_metadata __used __syscall_meta__poll = { .name = "sys""_poll", .syscall_nr = -1, .nb_args = 3, .types = 3 ? types__poll : NULL, .args = 3 ? args__poll : NULL, .enter_event = &event_enter__poll, .exit_event = &event_exit__poll, .enter_fields = LIST_HEAD_INIT(__syscall_meta__poll.enter_fields), }; 

static struct syscall_metadata __used __attribute__((section("__syscalls_metadata"))) *__p_syscall_meta__poll = &__syscall_meta__poll; 

asmlinkage long sys_poll(__MAP(3,__SC_DECL,struct pollfd __user *, ufds, unsigned int, nfds, int, timeout_msecs)) __attribute__((alias(__stringify(SyS_poll)))); 

static inline long SYSC_poll(__MAP(3,__SC_DECL,struct pollfd __user *, ufds, unsigned int, nfds, int, timeout_msecs)); 
asmlinkage long SyS_poll(__MAP(3,__SC_LONG,struct pollfd __user *, ufds, unsigned int, nfds, int, timeout_msecs)); 

asmlinkage long SyS_poll(__MAP(3,__SC_LONG,struct pollfd __user *, ufds, unsigned int, nfds, int, timeout_msecs)) 
{ 
    long ret = SYSC_poll(__MAP(3,__SC_CAST,struct pollfd __user *, ufds, unsigned int, nfds, int, timeout_msecs)); 
    __MAP(3,__SC_TEST,struct pollfd __user *, ufds, unsigned int, nfds, int, timeout_msecs); 
    __PROTECT(3, ret,__MAP(3,__SC_ARGS,struct pollfd __user *, ufds, unsigned int, nfds, int, timeout_msecs)); 
    return ret; 
} 

static inline long SYSC_poll(__MAP(3,__SC_DECL,struct pollfd __user *, ufds, unsigned int, nfds, int, timeout_msecs))
{
 struct timespec end_time, *to = NULL;
 int ret;

 if (timeout_msecs >= 0) {
  to = &end_time;
  poll_select_set_timeout(to, timeout_msecs / MSEC_PER_SEC,
    NSEC_PER_MSEC * (timeout_msecs % MSEC_PER_SEC));
 }

 ret = do_sys_poll(ufds, nfds, to);

 if (ret == -EINTR) {
  struct restart_block *restart_block;

  restart_block = &current->restart_block;
  restart_block->fn = do_restart_poll;
  restart_block->poll.ufds = ufds;
  restart_block->poll.nfds = nfds;

  if (timeout_msecs >= 0) {
   restart_block->poll.tv_sec = end_time.tv_sec;
   restart_block->poll.tv_nsec = end_time.tv_nsec;
   restart_block->poll.has_timeout = 1;
  } else
   restart_block->poll.has_timeout = 0;

  ret = -ERESTART_RESTARTBLOCK;
 }
 return ret;
}
